//
//  TravelRouteInfoViewController.m
//  homeland
//
//  Created by caesar on 14-3-4.
//  Copyright (c) 2014年 xzysun. All rights reserved.
//

#import "TravelRouteInfoViewController.h"
#import <UIKit/UIKit.h>
#import "TravelViewController.h"
#import "UIImageView+WebCache.h"
#import "WetLandBookingViewController.h"
#import "BookingListViewController.h"
#import "UserInfoService.h"
@interface TravelRouteInfoViewController ()

@end

@implementation TravelRouteInfoViewController
@synthesize dictRoute;//数据
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"----------------viewDidLoad----------------" );
    NSLog(@"----------------viewDidLoad----------------" );
    if (dictRoute!=nil&&dictRoute.count>0) {
        NSLog(@"%@",[dictRoute objectForKey:@"item1"]);
        UIImage *img = [UIImage imageNamed:[dictRoute objectForKey:@"image"]];
        self.img.image=img;
        self.imgtext.text=[dictRoute objectForKey:@"item1"];
        self.conenttext.text=[dictRoute objectForKey:@"item2"];
        self.address.text=[dictRoute objectForKey:@"item3"];
        self.carNumber.text=[dictRoute objectForKey:@"item4"];
    }
    [self.scroll addSubview:self.view];//把view添加到scrollView
     self.scroll.contentSize = CGSizeMake(320.0f, 999.0f);
    if (self.config!=nil) {
        NSString *myValue=[self.config objectForKey:@"key"];
        self.title=myValue;
    }
 
        
         CGRect frame = self.scroll.frame;
    
         self.scroll.frame = frame;
        //调整高度
         CGFloat infoHeight = [self caculateHeightForString:self.conenttext.text AndFontSize:14.0 AndWitdh:300];
         CGRect content = self.conenttext.frame;
         content.size.height = infoHeight;
         self.conenttext.frame = content;
         self.scroll.contentSize = CGSizeMake(320.0f, 666.0f);
 
    
     self.imgtext.textAlignment=NSTextAlignmentCenter;//对齐
}


@end
